//
//  UFOdrawerViewController.m
//  unrivalledForUniverse
//
//  Created by dllo on 16/1/20.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "UFOdrawerViewController.h"
#import "UFOLeftViewController.h"
#import "UFOLQCHeroViewController.h"
@interface UFOdrawerViewController () <UFOLQCHeroViewControllerDelegate>
@property (nonatomic, retain) UFOLeftViewController *leftVC;
@property (nonatomic, retain) UFOLQCHeroViewController *centerVC;
@end

@implementation UFOdrawerViewController
- (void)dealloc
{
    [_centerVC release];
    [_leftVC release];
    [super dealloc];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.view.backgroundColor = [UIColor greenColor];
    
    self.leftVC = [[UFOLeftViewController alloc] init];
    [self addChildViewController:self.leftVC];
    self.leftVC.view.frame = CGRectMake(-self.view.frame.size.width, 0, self.view.frame.size.width , self.view.frame.size.height);
    [self.view addSubview:self.leftVC.view];
    
    UFOLQCHeroViewController *centerVC = [[UFOLQCHeroViewController alloc] init];
    self.centerVC = [[UINavigationController alloc] initWithRootViewController:centerVC];
    centerVC.delegate = self;
    [self addChildViewController:self.centerVC];
    self.centerVC.view.frame = self.view.frame;
    [self.view addSubview:self.centerVC.view];
    

    UISwipeGestureRecognizer *swipeGR = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeAction)];
    swipeGR.direction = UISwipeGestureRecognizerDirectionRight;
    [self.centerVC.view addGestureRecognizer:swipeGR];
    [swipeGR release];

    
   

    
}


- (void)clickToColour
{
    
    
    [UIView animateWithDuration:0.5 animations:^{
        
        self.leftVC.view.frame = CGRectMake(0, 0, self.view.frame.size.width - 80, self.view.frame.size.height);
        
        self.centerVC.view.frame = CGRectMake(self.view.frame.size.width - 80, 0, self.view.frame.size.width, self.view.frame.size.height);
        
        
    }];
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
